package views.components {
	import flash.text.TextField;
	import flash.display.MovieClip;
	/**
	 * @author Alexander Slavshik
	 * created 4.3.2011
	 */
	public class CalNote {
		private var _mc : MovieClip;
		private var _labelTf : TextField;
		private var _caption1 : String;
		private var _caption2 : String;
		private var _caption5 : String;
		private var _value : Number;
		private var _valueTf : TextField;
		
		public function CalNote(mc:MovieClip, caption1:String, caption2:String, caption5:String) {
			_mc = mc;
			_labelTf = _mc.label_txt;
			_valueTf = _mc.num_txt;
			
			_caption1 = caption1;
			_caption2 = caption2;
			_caption5 = caption5;
		}

		public function set value(value : Number) : void {
			_value = value;
			_valueTf.text = String(_value);
			
			var val1:int = int(String(_value).substr(-1));
			if(val1 == 1) _labelTf.text = _caption1;
			if(val1 > 1 && val1 < 5) _labelTf.text = _caption2;
			if(val1 == 0 || val1 > 5) _labelTf.text = _caption5;
		}
	}
}
